//
//  MPMainViewOptionsController.m
//  MissPaparazzi
//
//  Created by Alexey Aleshkov on 17.09.12.
//  Copyright (c) 2012 DzeTech. All rights reserved.
//


#import "MPMainViewOptionsController.h"


@interface MPMainViewOptionsController ()
- (IBAction)buyAllButtonTouchUpInsideAction:(id)sender;
- (IBAction)restorePurchasesButtonTouchUpInsideAction:(id)sender;
@end


@implementation MPMainViewOptionsController

@synthesize delegate = _delegate;
@synthesize buyAllButton = _buyAllButton;
@synthesize restorePurchasesButton = _restorePurchasesButton;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}

- (void)dealloc
{
	[_buyAllButton release];
	[_restorePurchasesButton release];
	[super dealloc];
}

- (void)viewDidLoad
{
    [super viewDidLoad];

	NSString *leftBarRestorePurchaseButtonTitle = NSLocalizedString(@"MainView.NavigationItem.RestorePurchases", @"");
	[_restorePurchasesButton setTitle:leftBarRestorePurchaseButtonTitle forState:UIControlStateNormal];
	[_restorePurchasesButton setPurpleStyle];
	
	NSString *rightBarBuyAllButtonTitle = NSLocalizedString(@"MainView.NavigationItem.BuyAll", @"");
	[_buyAllButton setTitle:rightBarBuyAllButtonTitle forState:UIControlStateNormal];
	[_buyAllButton setMPNavigationBarTitleStyle];
}

- (void)viewDidUnload
{
	[_buyAllButton release];
	_buyAllButton = nil;
	[_restorePurchasesButton release];
	_restorePurchasesButton = nil;
    [super viewDidUnload];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	return YES;
}

#pragma mark -
#pragma mark Actions

- (IBAction)buyAllButtonTouchUpInsideAction:(id)sender
{
	[_delegate buyAllButtonTouchUpInsideAction:sender];
}

- (IBAction)restorePurchasesButtonTouchUpInsideAction:(id)sender
{
	[_delegate restorePurchasesButtonTouchUpInsideAction:sender];
}

@end
